<!DOCTYPE html>
  <html>
  <head>
      <meta charset="utf-8">
      <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
      <title>个人中心</title>
      <link rel="stylesheet" type="text/css" href="../../css/api.css" />
      <link rel="stylesheet" type="text/css" href="../../css/common.css" />
      <link rel="stylesheet" type="text/css" href="../../css/aui.css" />
    	<link rel="stylesheet" type="text/css" href="../../css/aui-pull-refresh.css" />
      <style>
          html, body {width: 100%;min-height: 100%;background: #F3EFEE;}
          .aui-active .aui-bar-tab-label{
            color: #f5a51c
          }
          .login {height:11rem;}
      	  .login .personal_logo {width: 3rem;height: 3rem;border-radius: 50%;}
      		.login .userinfo .title {font-size: 0.8rem; color: #fff;}
      		/* 设置条目 */
      		.item {height: 3rem;line-height: 3rem;padding-left: 0.7rem;background-color: #fff;}
      		.item_ico {float: left;width: 2.3rem;padding: 0.7rem 0.7rem 0.7rem 0;}
      		.item_arrow {float: right;width: 1.5rem;padding: 1rem 0.7rem 1rem 0;}
      		.item span {font-size: 0.7rem;}
          [v-cloak] {
              display: none;
          }
          #header_top {
            background: #fff;
          }
          #header_top .aui-icon-left,
          #header_top .aui-title,
          #header_top .aui-icon-search,
          #header_top .aui-pull-right .aui-iconfont {
            color: #333;
          }
          .userinfo{
            width: 100% !important;
            height: 100% !important;
            padding-top: 15%;
            position: relative;
            text-align: center;
          }

      </style>

  </head>
  <body>

<div id="app" >
  <header class="aui-bar aui-bar-nav" id="header_top">
    <a class="aui-pull-left aui-btn" onclick="goback()">
        <span class="aui-iconfont aui-icon-left"></span>
    </a>
    <div class="aui-title">店铺兑换币</div>
    <a class="aui-pull-right aui-btn" onclick="goback()">
        明细
    </a>
  </header>

  <div class="aui-refresh-content">
    <div class="aui-content" style="overflow:hidden">
     <div class="login" style="background:#40434A;padding-top:2rem">
       <!-- <img src="../../image/personal_bkg.jpg" alt="" class="loginbg"> -->
       <div class="userinfo" style="background:url(../../image/my/m57.png) no-repeat center bottom;background-size:90% 100%">

        <div style="text-align:center;width: 100%;">
          <div style="color:#fff;font-size:1.5rem;letter-spacing:0.1rem">{{dataInfo.money | moneyFilter}}</div>
          <div style="color:#fff;font-size: 0.7rem;">我的兑换币</div>
        </div>

       </div>
     </div>
   </div>
   <ul class="aui-list aui-media-list">
     <li class="aui-list-item aui-list-item-middle" @click="to_tx()">
         <div class="aui-media-list-item-inner">
             <div class="aui-list-item-media" style="width:3rem">
                 <img src="../../image/my/m48.jpg" class="aui-img-round aui-list-img-sm" style="width: 2rem;height: 2rem;">
             </div>
             <div class="aui-list-item-inner aui-list-item-arrow">
                提现
             </div>
         </div>
     </li>
     <li class="aui-list-item aui-list-item-middle" @click="look_gz()">
         <div class="aui-media-list-item-inner">
             <div class="aui-list-item-media" style="width:3rem">
                 <img src="../../image/my/m58.png" class="aui-list-img-sm" style="width: 1.2rem;height: 1.2rem;margin-left: 0.5rem;">
             </div>
             <div class="aui-list-item-inner aui-list-item-arrow">
                提现规则
             </div>
         </div>
     </li>
    </ul>
  <div>
</div>
  </body>
  <script type="text/javascript" src="../../script/api.js"></script>
  <script type="text/javascript" src="../../script/zepto.js"></script>
  <script type="text/javascript" src="../../script/vue.min.js"></script>
  <script type="text/javascript" src="../../script/utils.js"></script>
  <script type="text/javascript" src="../../script/common.js"></script>
  <script type="text/javascript" src="../../script/aui-tab.js"></script>
  <script type="text/javascript" src="../../script/aui-scroll.js"></script>
  <script type="text/javascript" src="../../script/aui-pull-refresh.js"></script>
  <script type="text/javascript">

      function goback(){
        api.closeWin();
      }

      apiready = function(){
        new Vue({
          el:"#app",
          data:{
            dataInfo:{},
            url:""
          },
          methods:{
            getDataInfo:function(){
              var _this = this;
              api.ajax({
                  url: window.Url.Freestore_balance,
                  method: 'post',
                  data: {
                      values: {
                          token: $api.getStorage('token'),
                          type:3

                      }
                  }
              },function(ret, err){
                  if (ret.re == 1) {

                      _this.dataInfo = ret.data
                      _this.url = ret.data.url;

                  } else {
                      alert( ret.info );
                  }
              });

            },
            // 提现
            to_tx:function(){
              $api.setStorage('dp_tx_type', 3);

              api.openWin({
                  name: 'withdraw2_header',
                  url: './headerone.html',
                  pageParam: {
                        msg:'提现',
                        url:'./withdraw2.html'
                  }
              });
            },
            // 查看规则
            look_gz:function(){
              var $_this = this;
              api.openFrame({
                  name: 'dhgz_frm',
                  url: 'dhgz_frame.html',
                  rect: {
                      x: 0,
                      y: 0,
                      w: 'auto',
                      h: 'auto'
                  },
                  pageParam: {
                      url:$_this.url
                  },
                  bounces: false,
                  bgColor: 'rgba(0,0,0,0)'
              });
            },

          },
          mounted(){
            this.getDataInfo();
            setRefresh()
          },
          filters:{
            moneyFilter(value){
              if (value != undefined) return  Base64.decode(value).slice(3,-5)
            }
          }

        })

      };


      //刷新
      function setRefresh() {
          var pullRefresh = new auiPullToRefresh({
              container: document.querySelector('.aui-refresh-content'),
              triggerDistance: 100
          }, function(ret) {

              if (ret.status == "success") {
                  setTimeout(function() {
                      pullRefresh.cancelLoading(); //刷新成功后调用此方法隐藏
                  }, 1500)
              }
          })
      }

  </script>
  </html>
